<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <title>流程管理</title>
    <#include '../include/common.html'/>
    <script type="text/javascript" src="<@s.url '/resources/process/js/instance.js'/>"></script>
</head>
<body>
<button class="layui-btn layui-btn-normal" onclick="javascript:location.reload();" title="刷新"><i class="layui-icon">&#x1002;</i>刷新</button>
<br>
<table class="layui-table">
    <thead>
    <tr>
        <th>ProcessDefinitionId</th>
        <th>ProcessDefinitionName</th>
        <th>ProcessDefinitionKey</th>
        <th>ProcessDefinitionVersion</th>
        <th>ProcessInstanceId</th>
        <th>DeploymentId</th>
        <th>BusinessKey</th>
        <th>Name</th>
        <th>Description</th>
        <th>状态</th>
        <th width="140px">操作</th>
    </tr>
    </thead>
    <tbody>
    <#list instances as p>
    <tr>
        <td>${p.processDefinitionId!}</td>
        <td>${p.processDefinitionName!}</td>
        <td>${p.processDefinitionKey!}</td>
        <td>${p.processDefinitionVersion!}</td>
        <td>${p.processInstanceId!}</td>
        <td>${p.deploymentId!}</td>
        <td>${p.businessKey!}</td>
        <td>${p.name!}</td>
        <td>${p.description!}</td>
        <td>${p.suspended?string("挂起","激活")}</td>
        <td>
            <div class="layui-btn-group">
            <a class="layui-btn layui-btn-mini" href="<@s.url '/process/instance/viewHistory.htm?processInstanceId='/>${p.processInstanceId!}">历史</a>
            <button class="layui-btn layui-btn-mini  layui-btn-danger" onclick="del('${p.processInstanceId}',false)">删除</button>
            <button class="layui-btn layui-btn-mini  layui-btn-danger" onclick="del('${p.processInstanceId}',true)">删除(含历史)</button>
                <#if p.suspended>
                    <button class="layui-btn layui-btn-mini" onclick="suspendOrActivate('${p.id}','activate')">激活</button>
                    <#else>
                        <button class="layui-btn layui-btn-mini" onclick="suspendOrActivate('${p.id}','suspend')">挂起</button>
                </#if>
            </div>
        </td>
    </tr>
    </#list>
    </tbody>
</table>
</body>
</html>